﻿<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/static/include/top.jsp"%>

<script>
	document.title = "主页";
</script>
<script type="text/javascript">
//查看
	function openViewReport(id){
		var url="${ctx}/reports/service.do?method=showReportInfo&reportOperatorId=${user.id}&reportId="+id;
		openWin("查看报表",url,$(parent).width() - 100,550,reSubmit);
	}
	
	//填报
	function openReportWin(userId,reportTypeId,reportTimetype,reportUnitIndustry,reportYearTime,reportQuarter,reportMonth,status){
		var url="${ctx}/reports/service.do?method=showCreateReport&reportOperatorId="+userId+"&reportProxyId=${user.id}&reportTypeId="+reportTypeId+
		"&timeType=" + reportTimetype + "&unitIndustryId=" + reportUnitIndustry + "&yearType=" + reportYearTime + "&quarterDate=" +
		reportQuarter + "&reportVersion=" + 1 + "&timeDate=" + reportMonth+"&status="+status;
		openWin("报表填报",url,$(parent).width() - 100,550,reSubmit);
	}

	//修改
	function openEditWin(id){
		var url="${ctx}/reports/service.do?method=showReportUpdate&reportOperatorId=${user.id}&reportId="+id;
		openWin("修改报表",url,$(parent).width() - 100,550,reSubmit);
	}
	//重新提交表单
	function reSubmit(){
		location.reload(true);
	}
	function getList() {
		var url = "${baseURL}/monitor/pm";
		window.location.href(url);
	}
	function getbillboard()
	{
		var url = "${baseURL}/monitor/upp";
		window.location.href(url);
		
	}
	function openViewWin(id) {
		openWin("查看详情","${baseURL}/monitor/pmdetail?id="+id,600,500);
		//window.open("${baseURL}/monitor/pmdetail?id=" + id, "viewwindow", "width=500,height=600")
	}
	function sendMes() {
		openWin("发送消息","${baseURL}/monitor/sendMes",600,600);
		//window.open("${baseURL}/monitor/sendMes", "newwindow", "width=500,height=600")
	}
	
	
	$(document).ready(function(){
		if ("${runMode}" == "WEB"){
			$("#tab_left").html($("#tab_right_top").html());
			$("#tab_right_top").html($("#tab_right_bottom").html());
			$("#tab_right_top").attr("rowspan", "2");
			$("#tab_right_bottom").html("");
			$("#tab_right_bottom").css("display", "none");
		}
		$("#dataTable").css("height", $(window).height()-60);
		$("#tab_left").css("height", $(window).height()-100);
		$("#todo").css("height", $(window).height()-100);
		$("#tab_right_top").css("height", $(window).height()/2-120);
		$("#tab_right_bottom").css("height", $(window).height()/2-120);
	});
	
</script>
<table id="dataTable">
	<tr>
		<td id="tab_left" style="width: 45%;" rowspan="2" valign="top">
			<table>
				<tbody>
					<tr>
						<th><img src="${ctx}/static/images/pages/cen/rig/ico_01.png" align="absmiddle">&nbsp;待填报</th>
					</tr>

				</tbody>
			</table>
			<div id="todo" style="overflow-y:scroll;">
			<table id="listTable" border="1">
				<tbody>
					<tr>
						<th width="70%">待填报报表</th>
						<th>操作</th>
					</tr>
					<c:forEach var="oneRow" items="${reportList}">
						<tr>
							<td align="left">${oneRow.reportDomainName}</td>
							<td align="left">
							<c:choose>
							<c:when test="${oneRow.status==1}"><a href="#" class="tab_text01" onclick="openReportWin('${oneRow.userId}','${oneRow.reportTypeId}','${oneRow.reportTimetype}','${oneRow.reportUnitIndustry}','${oneRow.reportYearTime}','${oneRow.reportQuarter}','${oneRow.reportMonth}','${oneRow.status}');return false;">填报</a></c:when>
							<c:when test="${oneRow.status==2}"><a href="#" class="tab_text01" onclick="openReportWin('${oneRow.userId}','${oneRow.reportTypeId}','${oneRow.reportTimetype}','${oneRow.reportUnitIndustry}','${oneRow.reportYearTime}','${oneRow.reportQuarter}','${oneRow.reportMonth}','${oneRow.status}');return false;">迟报</a></c:when>
							<c:when test="${oneRow.status==3}"><a href="#" class="tab_text01" onclick="openEditWin('${oneRow.id}');return false;">修改</a></c:when>
							<c:when test="${oneRow.status==4}"><a href="#" class="tab_text01" onclick="openViewReport('${oneRow.id}');return false;">查看</a></c:when>
							</c:choose>
							</td>
						</tr>
					</c:forEach>
				</tbody>
			</table>
			</div>
		</td>

		<td id="tab_right_top" style="width: 55%;" valign="top">
			<table  cellpadding="0">
				<tbody>
					<tr>
						<th><img src="${ctx}/static/images/pages/cen/rig/ico_01.png"
							align="absmiddle">&nbsp;消息管理</th>
					</tr>
					<tr class="tab_grey">
						<td>
							<form name="searchForm" action="" method="get">
								<input type="hidden" name="p" value="1" />  <a
									class="tab_but" href="#" onclick="sendMes();return false;">发送新消息</a><br>

							</form>
						</td>
					</tr>
					<tr>
						<td width="100%">
							<table id="listTable" style="float: left;width:100%" border="1">
								<tbody>
									<tr>
										<th width="10%">序号</th>
										<th width="20%">发送人</th>
										<th width="20%">标题</th>
										<th width="20%">发送时间</th>
										<th width="15%">状态</th>
										<th>操作</th>
									</tr>
									<c:forEach var="oneRow" items="${pmList}" varStatus="status">
										<tr>
											<td align="left">${status.index+1}</td>
											<td align="left">${oneRow.pmFromName}</td>
											<td align="left">${oneRow.title}</td>
											<td align="left">${oneRow.sendTime}</td>
											<td align="left">${oneRow.isRead==1?'已读':'未读'}</td>
											<td align="left"><a href="#" id="tab_text01"
												onclick="openViewWin('${oneRow.id}')">查看</a></td>
										</tr>
									</c:forEach>
								</tbody>
							</table>
						</td>
					</tr>
				</tbody>
			</table>

		</td>
	</tr>

	<tr>
		<td id="tab_right_bottom" valign="top">
			<table>
				<tbody>
					<tr>
						<th colspan="4"><img src="${ctx}/static/images/pages/cen/rig/ico_01.png"
							align="absmiddle">&nbsp;催报信息列表</th>
					</tr>
			
			<tr>
				<th width="20%">标题</th>
				<th width="40%">内容</th>
				<th width="20%">催报时间</th>
				<th width="20%">操作</th>
			</tr>
			<c:forEach var="oneRow" items="${billboardIndustryList}">
			<tr>
				<td align="left">${oneRow.billboardTitle}</td>
				<td align="left">${oneRow.billboardContent}</td>
				<td align="left"><fmt:formatDate value="${oneRow.billboardDate}" pattern="yyyy-MM-dd" /></td>
				<td align="left"><a href="#" id="tab_text01" onclick="openBillWin('${oneRow.id}');return false;">详情</a></td>
			</tr>
			</c:forEach>
		</tbody>
	</table>
		</td>
	</tr>
</table>

	<script type="text/javascript">
	//填报
	function openBillWin(id){
		var url="${ctx}/company/billboard/toFillReportList?id=" +id;
		openWin("查看催报报表",url,600,400);
	}
		function setTableHeight() {
			$("#dataTable").height(document.body.clientHeight - 60);
		}
		$(window).resize(function() {
			setTableHeight();
		})
		$(document).ready(function() {
			setTableHeight();
		})
	</script>
<%@ include file="/static/include/bottom.jsp"%>
